<?php
include './inc/PAGE.php';
$p = new PAGE("");

$loginOk = $p->s()->getvar("loginOk");
$username = $p->s()->getvar("username");
$type = $p->s()->getvar("type");

if($loginOk==1  && strlen($username)>0 && ($type==ADMIN || $type==LIB)) {
    $p = new PAGE("Προσθήκη \"".$p->t()->canregister($type)."\"");
    $errors = $_GET['errors'];
    $values = $_GET['values'];
}else {
    header("Location: ./index.php");
}
?>
<form action="ze_user_librarian_add_do.php" method="POST">
    <table border="0" align="center" class="tableform">
        <thead>
            <tr>
                <th colspan="2" align="center">Προσθήκη "<?=$p->t()->canregister($type)?>"</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td align="right" style="vertical-align: top">Επιθυμητό όνομα χρήστη:</td>
                <td><input type="text" name="register[]" value="<?=$values[0]?>"/><br/><font color="red"><?=$errors[0];?></font><font color="red"><?=$errors[1];?></font></td>
            </tr>
            <tr>
                <td align="right" style="vertical-align: top">Κωδικός:</td>
                <td><input type="password" name="register[]" value="" /><br/><font color="red"><?=$errors[2];?></font></td>
            </tr>
            <tr>
                <td align="right" style="vertical-align: top">Κωδικός (επαλήθευση):</td>
                <td><input type="password" name="register[]" value="" /><br/><font color="red"><?=$errors[3];?><?=$errors[4];?></font></td>
            </tr>
            <tr>
                <td align="right" style="vertical-align: top">Ονομ/νυμο:</td>
                <td><input type="text" name="register[]" value="<?=$values[3]?>" /><br/><font color="red"><?=$errors[5];?></font></td>
            </tr>
            <tr>
                <td align="right" style="vertical-align: top">email:</td>
                <td><input type="text" name="register[]" value="<?=$values[4]?>" /><br/><font color="red"><?=$errors[6];?></font></td>
            </tr>
            <tr>
                <td align="right" style="vertical-align: top">Τηλέφωνο:</td>
                <td><input type="text" name="register[]" value="<?=$values[5]?>" /><br/><font color="red"><?=$errors[7];?></font></td>
            </tr>
            <tr>
                <td align="right"><input type="reset" value="Καθαρισμός" /></td>
                <td><input type="submit" value="Καταχώρηση" /></td>
            </tr>
        </tbody>
    </table>
</form>

<?php
$p->close();
?>